---
title: Mplayer's FIFO
date: 2012-08-14
---
I was incredibly excited when I found out that mplayer can be controlled via a FIFO. It wasn't a huge suprise as ofcourse there must be some IPC for mplayer, but still, this is awesome.

First make the FIFO for mplayer:

```bash
mkfifo /home/mil/fifos/mplayer
```

Now, you can control mplayer via the FIFO by specifying a file with -input:

```bash
mplayer -input file=/home/mil/fifos/mplayer somemediafiles 
echo "pt_step 1" > /home/mil/fifos/mplayer
echo "pause" > /home/mil/fifos/mplayer
```

Let's see all the available commands that the FIFO accepts:

```bash
mplayer -input cmdlist
```

And finally if you don't want to have to use the -input file= syntax every time you start mplayer, you can have mplayer by default open the FIFO by specifying the path to your FIFO in your ~/.mplayer/config:

```bash
> cat ~/.mplayer/config
# mplayer config file
input=file=/home/mil/fifos/mplayer
```

And that's all. Use mplayer's FIFO. Here's a link to [all the commands](http://www.mplayerhq.hu/DOCS/tech/slave.txt) the FIFO accepts.
